package pers.wensheng.patterns.creator_pattern.prototype_pattern.shallow_clone.demo2;

/**
 * 访问测试类
 * 对象的创建非常复杂，可以使用原型模式快捷的创建对象。
 * 性能和安全要求比较高。
 */
public class Client {
    public static void main(String[] args) throws CloneNotSupportedException {
        Citation citation = new Citation();
        citation.setStudent(new Student("张三"));

        Citation cloned = citation.clone();

        System.out.println(citation.getStudent());
        System.out.println(cloned.getStudent());

        cloned.getStudent().setName("李四");


        citation.show();
        cloned.show();
    }
}
